#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
    int second = 0;
    int h = 0;
    int m = 0;
    int s = 0;
    scanf("%d", &second);
    h = second / 3600;
    m = second % 3600 / 60;
    s = second - (h * 3600) - (m * 60);
    printf("%d %d %d\n", h, m, s);

    return 0;
}